<%@page import="models.User"%>
<%@page import="java.util.TreeMap"%>
<%@page import="models.Blog"%>
<%@page import="models.AutoSite"%>
<%@page import="java.util.ArrayList"%>
<%@page import="java.net.URLEncoder"%>
<%
	ArrayList<AutoSite> sites = (ArrayList<AutoSite>) request.getAttribute("sites");
	AutoSite autoSite = (AutoSite) request.getAttribute("autoSite");
	Blog blog = (Blog) request.getAttribute("blog");
	String success = (String) request.getAttribute("success");
	User user = (User) request.getAttribute("user");
%>

<jsp:include page="/layouts/header.jsp">
	<jsp:param name="title" value="" />
	<jsp:param name="description" value="" />
	<jsp:param name="keywords" value="" />
	<jsp:param name="page" value="home" />
</jsp:include>

<div id="userform" class="clearafter">
	<h1>Get Auto Content</h1><hr/>
	<div class="submitlink">
		<form method="post" action="" name="submitlink">
			
		</form>
	</div>
	<div class="howdy">
		<h2 class="title">Hi, <%=user.getName() != null ? user.getName() : "" %></h2>
		Blog: <b><%=blog.getBlogId() %></b> <br />
		Type: <b><%=blog.getType() %></b> <br />
		User: <b><%=blog.getUsername() %></b> <br />
		<div class="bt-line"></div>
		<ul class="option">
			<li><a href="/add-blog">Add blog</a></li>
			<li><a href="/add-site?blogId=<%=blog.getBlogId()%>">Add Content Site</a></li>
			<li><a href="/get-content?blogId=<%=blog.getBlogId()%>">Get Special Content</a></li>
			<li><a href="/view-profile">View profile</a></li>
			<li><a href="/logout">Logout</a></li>
		</ul>
		<h2 class="title" style="padding-top: 20px;">List sites</h2>
		<div class="listlink">
			<ul>
				<% for (int i = 0; i < sites.size(); i++) { %>
					<li><a class="site-icon <%=sites.get(i).getStatus()==0 ? "inactive" : "" %>" style="background-image: url('https://s2.googleusercontent.com/s2/favicons?domain_url=<%=sites.get(i).getSite()%>');"
							href="/view-site?siteId=<%=URLEncoder.encode(sites.get(i).getId())%>"><%=sites.get(i).getSite() %></a></li>
				<% } %>
			</ul>
		</div>
	</div>
	<div class="clearbreak"></div>
	<hr />
	<div class="checkresult">
		
	</div>
</div>
<script type="text/javascript">
<!--
 var blogId = "<%=blog.getBlogId()%>";
//-->
</script>
<script type="text/javascript" src="/js/form_site.js"></script>
<%@ include file='/layouts/footer.jsp'%>